<?php

namespace app\index\controller;
use app\commons\model\MemberVideo;
use think\exception\ValidateException;
use think\Db;

class SaleMemberVideo
{
    /**
     * 参与用户活动视频数据
     */
    public function index(MemberVideo $memberVideo){
        $data = request()->param();
        $sale_id = $data['sale_id'] ?? 0;
        $user_id = $data['user_id'] ?? 0;
        if(!$user_id || !$sale_id) throw new ValidateException('参数错误！');
        $list = Db::name('member_video')->where(['sale_id'=>$data['sale_id'],'member_id'=>$data['user_id']])->paginate(10,false,['query'=>request()->param()]);
        return jsonp($list);
    }
}